#!/bin/sh

# Fetch the path relative to the launch point where this shell script exists. Taken from macpack
APP_PATH=`echo "$0" | awk '{split($0,patharr,"/"); idx=1; while(patharr[idx+3] != "") { if (patharr[idx] != "/") {printf("%s/", patharr[idx]); idx++ }} }'`

APP_PATH=`cd "$APP_PATH"; pwd` #get absolute path

cd "${APP_PATH}/Contents/MacOS"
MONO_FRAMEWORK_PATH="$APP_PATH/../mono-6.8.0.105-s1"

cd ../Resources

export MONO_GAC_PREFIX=$MONO_FRAMEWORK_PATH
export MONO_PATH="$MONO_FRAMEWORK_PATH/lib"
export MONO_CFG_DIR="$MONO_FRAMEWORK_PATH/etc"
export LC_CTYPE="en_US.UTF-8"


# 2018-09-20 only used for launching updater
# Setting DYLD_LIBRARY_PATH is not needed for the updater.
# more details in package app

"../MacOS/Axure RP Updater" "$APP_PATH/../AxureRPUpdater.exe" $@
